﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Galaxy_Wars
{
    class Player
    {
        private int id;
        private string name;
        List<int> planets = new List<int>();

        public Player(int id, string name) 
        {
            this.id = id;
            this.name = name;
        }

        public List<int> ownsPlanets
        {
        get { return planets;}
        }

        public void removePlanet(int planetnumber) 
        {
            foreach (int p in planets) 
            {
                if(p == planetnumber)
                {
                    planets.Remove(p);
                }
            }
        }

        public void addPlanet(int planetnumber)
        {
            planets.Add(planetnumber);
        }
    }
}
